KISSY.use("node",function(S,Node){ 
GS.addListener('cajaupload',function(d){

		var response = KISSY.JSON.parse(d.content);
		var info = KISSY.DOM.get(".fileInfo");
		var img = KISSY.DOM.get('.uImage',info);
		var st = KISSY.DOM.get(".fileStatus", info);
		var name = KISSY.DOM.get(".fileName", info);
		var ID = KISSY.DOM.get(".fileId", info);
		var size = KISSY.DOM.get(".fileSize", info);
		var url = KISSY.DOM.get(".fileUrl", info);
		
		if(response['success']){
			st.innerHTML = "成功";
			img.innerHTML = '<a href="'+response['url']+'"><img src="'+response['url']+'" width="64" /></a>';
			name.innerHTML = response['name'];
			ID.innerHTML = response['id'];
			size.innerHTML = response['size'];
			url.innerHTML = response['url'];
			
			
		}else{
			st.innerHTML = "失败";
			img.innerHTML = "";
			name.innerHTML = "";
			ID.innerHTML = "";
			size.innerHTML = "";
			url.innerHTML = "";
		}
		var results = KISSY.DOM.get(".results");
		results.innerHTML += "<li>"+d.content+"</li>";
	});
	
	
TOP.ui("login-btn", {
container:".top-login-btn-container",
type:"1,1",
callback:{
   login:function(user){alert(user)},
   logout:function(){}
}});
    TOP.ui("sku", {
      container:".top-widget-sku",
      text:"加入购物车",
      itemId:"1500005335501",
      type:"",
      callback:{
         addCartSuccess:function(e){console && console.log(e);},
         error:function(e){console && console.log(e);}
    }
    });
	    TOP.ui("ilike", {
      container:".top-ilike-container",
      nick:"kekydream",
      position:"v",
      bc:"#DA4701",
      width:"150"
    });
$(".hhh").on("click",function(){
alert('ok');
TOP.api('rest', 'get',{
     method:'taobao.userrecommend.items.get',
     recommend_type:'1',
     count:'10'
},function(resp){
alert('ok');
     if(resp.error_response){
     alert('taobao.taobaoke.widget.items.convert接口获取商品信息品失败!'+resp.error_response.msg);
     return false;
       }
var respItem=resp.taobaoke_items.taobaoke_item;
     for(var i=0;i<respItem.length;i++){
     //$("#r"+respItem[i].num_iid).html("佣金："+Number(respItem[i].commission_rate)/100+"%");
     //$("#a"+respItem[i].num_iid).attr("href",respItem[i].click_url);
}});
});
$(".test").on("click",function(){alert('asdfsd');SNS.alert("你还没有指定组或好友哦!", function(){alert("123")}, '', false);});

TOP.ui("authbtn", {
    container: '.top-authbtn-container',
    name:'立即使用',
    type:'mini',
    callback: function(data){
        console.log(data);
    }
});
});